home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-04-08 | 2.7 KB | 105 lines | [TEXT/CCL2] |
- #|
- default-handlers.lisp
-
- Defines the default Event Handlers used in the Mini-Application
- sample program.
-
- This file effectively defines the HyperCard-like protocols and
- null behavior for the Mini-Application's windows, and its palettes'
- items. The HyperTalk-like scripts must be added by the user.
-
- All objects have default handlers that do nothing, except
- for the window’s idle handler, which simply passes the
- idle event to objects in its window.
-
- Note that the mouse-down method for draw-items is over-ridden
- in the example application in mini-app-example.lisp.
-
- For further info, see files "About Mini-App" and "Instructions".
-
-
- Copyright 1990, 1991 by Ruben Kleiman for Apple Computer, Inc.
-
- Change History.
- 03-12-92 slm Updated file header comments.
-
- |#
-
- ;;; _______________________________________________________________________________
- ;;; Default Window handlers
-
- ;;; Called whenever the mouse enters the window
- (defmethod mouse-enter ((window draw-dialog) where)
- (declare (ignore where))
- )
-
- ;;; Called whenever the mouse is within the window
- (defmethod mouse-within ((window draw-dialog) where)
- (declare (ignore where))
- )
-
- ;;; Called whenever the mouse leaves the window
- (defmethod mouse-leave ((window draw-dialog) where)
- (declare (ignore where))
- )
-
- (defmethod key ((window draw-dialog) char)
- (declare (ignore char))
- )
-
- (defmethod mouse-down ((window draw-dialog) where)
- (declare (ignore where))
- )
-
- (defmethod mouse-up ((window draw-dialog) where)
- (declare (ignore where))
- )
-
- ;;; This is the default idle handler for a draw-dialog window
- (defmethod idle ((window draw-dialog))
- (dolist (item (slot-value window 'my-items))
- (idle item)))
-
-
- ;;; _________________________________________________________________________________
- ;;; Default draw-item handlers
- ;;;
- ;;; The default handlers do nothing.
-
- ;;; Called whenever the mouse enters the draw-item
- (defmethod mouse-enter ((item draw-item) where)
- (declare (ignore where))
- )
-
- ;;; Called whenever the mouse is within the draw-item
- (defmethod mouse-within ((item draw-item) where)
- (declare (ignore where))
- )
-
- ;;; Called whenever the mouse leaves the draw-item
- (defmethod mouse-leave ((item draw-item) where)
- (declare (ignore where))
- )
-
- (defmethod key ((item draw-item) char)
- ;; Pass newline to editable text box
- (if (char= char #\NewLine)
- (view-key-event-handler item char))
- )
-
- (defmethod mouse-down ((item draw-item) where)
- (declare (ignore where))
- (dialog-item-action item)
- )
-
- (defmethod mouse-up ((item draw-item) where)
- (declare (ignore where))
- )
-
- ;;; This is the default idle handler for a draw-item
- (defmethod idle ((item draw-item))
- )
-
- ;end of file default-handlers.lisp
- ;------------------------------------------------
-